home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / pd / mui / gravisimu / arexx / edit_xyv_alle.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-11  |  2KB  |  96 lines

  1. /* edit_xyv_alle.rexx
  2.  *
  3.  * Autor: Thies Wellpott
  4.  * Version: 1.1 (2.7.1994)
  5.  *
  6.  * Addiert bei allen Objekten zur x- und y-Koordinate und zur x- und
  7.  * y-Geschwindigkeit einen einzugebenden Betrag
  8.  */
  9.  
  10. IF ~Show("P", "GRAVISIMU.1") THEN
  11. DO
  12.    Say "GraviSimu ist nicht gestartet!"
  13.    Exit
  14. END /* IF */
  15.  
  16. Address "GRAVISIMU.1"
  17. Options Results
  18.  
  19. 'GetNumObjects'
  20. anz_obj = Result
  21. IF anz_obj = 0 THEN
  22. DO
  23.    Say "Es existieren keine Objekte!"
  24.    Exit
  25. END
  26.  
  27. Options Prompt ">> "
  28.  
  29. Say "Additionswert für die x-Koordinate (Kommazahl Leerzeichen"
  30. Say "Streckeneinheitsabkürzung)"
  31. Parse Pull ax ax_einh
  32. 'GetUnitM' ax_einh
  33. IF RC ~= 0 THEN
  34. DO
  35.    Say "Ungültige Streckeneinheit!"
  36.    Exit
  37. END
  38. ax = ax*Result
  39.  
  40. Say "Additionswert für die y-Koordinate (Kommazahl Leerzeichen"
  41. Say "Streckeneinheitsabkürzung)"
  42. Parse Pull ay ay_einh
  43. 'GetUnitM' ay_einh
  44. IF RC ~= 0 THEN
  45. DO
  46.    Say "Ungültige Streckeneinheit!"
  47.    Exit
  48. END
  49. ay = ay*Result
  50.  
  51. Say "Additionswert für die x-Geschwindigkeit (Kommazahl Leerzeichen"
  52. Say "Geschwindigkeitseinheitsabkürzung)"
  53. Parse Pull avx avx_einh
  54. 'GetUnitMS' avx_einh
  55. IF RC ~= 0 THEN
  56. DO
  57.    Say "Ungültige Streckeneinheit!"
  58.    Exit
  59. END
  60. avx = avx*Result
  61.  
  62. Say "Additionswert für die y-Geschwindigkeit (Kommazahl Leerzeichen"
  63. Say "Geschwindigkeitseinheitsabkürzung)"
  64. Parse Pull avy avy_einh
  65. 'GetUnitMS' avy_einh
  66. IF RC ~= 0 THEN
  67. DO
  68.    Say "Ungültige Streckeneinheit!"
  69.    Exit
  70. END
  71. avy = avy*Result
  72.  
  73. 'ObjectList Quiet'
  74. Say "Addiere..."
  75. DO FOR anz_obj
  76.    'GetObject 0'
  77.    Parse Var Result '"' name '"' m m_einh x y xy_einh vx vy v_einh rest
  78.    'GetUnitM' xy_einh
  79.    m_p_xy = Result
  80.    'GetUnitMS' v_einh
  81.    ms_p_v = Result
  82.  
  83.    'DeleteObject 0'
  84.  
  85.    x = x + ax/m_p_xy
  86.    y = y + ay/m_p_xy
  87.    vx = vx + avx/ms_p_v
  88.    vy = vy + avy/ms_p_v
  89.  
  90.    'NewObject "'name'"' m m_einh x y xy_einh vx vy v_einh rest
  91. END /* FOR i */
  92. 'ObjectList NoQuiet'
  93.  
  94. Exit
  95.  
  96.